package org.clipjoint.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * 	自定义application生命周期监听器
 * @author
 * date: 2021-1-13	
 *
 */
@WebListener
public class MyServletContextListener implements ServletContextListener {
	
    public void contextDestroyed(ServletContextEvent sce)  { 
    }

    public void contextInitialized(ServletContextEvent sce)  { 
    	ServletContext application = sce.getServletContext();
    	application.setAttribute("bp", application.getContextPath());
    }
	
}
